				<div class="section">
                	<script type="text/javascript">
					$(document).ready(function(){
						var $obj 	= $("#selectship");
						var $show 	= $("#room_show");
						var $ship   = $("#show_ship");
						var $ship_name = $("#ship_name");
						$obj.change(function(){
							$val = $(this).val();
							if($val == 0){alert("Please select a cruise!");}else{
								$.ajax({
									"url" 	: "<?php echo base_url(); ?>agency/checkrate/getrooms",
									"type"  : "post",
									"data"  : "val="+$val,
									"async" : false,
									success : function(result){
										$ship.html(result);
									}
								});
							}
						});
					});
					$(document).on("click","#ok",function(){
						$cabinid = $("#cabinid").val();
						if($cabinid == 0){
							alert("Please select a cabin");
							return false;
						}
					});
					</script>
					<!--[if !IE]>start title wrapper<![endif]-->
					<div class="title_wrapper">
						<span class="title_wrapper_top"></span>
						<div class="title_wrapper_inner">
							<span class="title_wrapper_middle"></span>
							<div class="title_wrapper_content">
								<h2 class="menu_title">Manage price</h2>
							</div>
						</div>
						<span class="title_wrapper_bottom"></span>
					</div>
					<!--[if !IE]>end title wrapper<![endif]-->
					
					<!--[if !IE]>start section content<![endif]-->
					<div class="section_content">
						<span class="section_content_top"></span>
						
						<div class="section_content_inner">
                        	<div class="table_tabs_menu">
							<!--[if !IE]>start  tabs<![endif]-->
							<!--[if !IE]>end  tabs<![endif]-->

							</div>
				<!--[if !IE]>start table_wrapper<![endif]-->
							<div class="table_wrapper" style="background:none;">
								<div class="table_wrapper_inner" style="min-height:300px">
                                	<style>
										input {
											width:65px;
										}
									</style>
									<div id="box">
                                   	Select cruise<select name="selectship" id="selectship">
                                        <option value="0">Select cruise</option>
                                        <?php
                                        foreach($listcruis as $items){
                                            echo "<option value='".$items['sheep_id']."'>".$items['sheep_name']."</option>";
                                        }
                                        ?>
                                    </select>
									<div style="margin:5px 0px">
									<form method="post">
                                    <div id="show_ship" style="margin-bottom:5px">
									Cabin Name <select name="cabinid" id="cabinid">
										<option value="0">Select cabin</option>
									</select>
                                    </div>
									Number night <select name="numbernight">
										<option <?php if($numbernight==1) echo 'selected="selected"'; ?> value="1">1</option>
										<option  <?php if($numbernight==2) echo 'selected="selected"'; ?> value="2">2</option>
									</select>
									
									From <input type="text" class="date" name="fromdate" required /> To <input type="text" class="date" name="todate" required />
									<input type="submit" name="ok" id="ok" value="Go"/>-- OR -- <a  href="<?php echo base_url(); ?>agency/checkrate/updateprice">Quick insert</a>
									</form>
									</div>
                                    <div id="loading" style="padding-bottom:5px;color:#F00;font-size:12px"></div>
									<table width="100%" border="1" style="border:solid #ccc 1px;position:relative" cellspacing="0">
									  <tr>
									<td>Day</td>
										<td>Room Available to sell</td>
										<td>Rack Rate</td>
										<td>Single Occupancy</td>
										<td>Double Occupancy</td>
										<td>Twin Occupancy</td>
										<td>Child Rate</td>
										<td>Infant Cost</td>
									  </tr>
									   <?php 
										foreach($listdata as $key=>$v){
										?>
										<tr>
										<td><?php echo $key; ?></td>
										<td><input type="text" value="<?php echo $v["numberavai"];?>" name="numberavai" datadate="<?php echo $key;?>" onchange="update(this);" /></td>
										<td><input type="text" value="<?php echo $v["priceold"];?>" name="priceold" datadate="<?php echo $key;?>" onchange="update(this);" /></td>
										<td><input type="text" value="<?php echo $v["pricesingle"];?>" name="pricesingle" datadate="<?php echo $key;?>" onchange="update(this);" /></td>
										<td><input type="text" value="<?php echo $v["pricedouble"];?>" name="pricedouble" datadate="<?php echo $key;?>" onchange="update(this);" /></td>
										<td><input type="text" value="<?php echo $v["pricetwin"];?>" name="pricetwin" datadate="<?php echo $key;?>" onchange="update(this);" /></td>
										<td><input type="text" value="<?php echo $v["pricechild"];?>" name="pricechild" datadate="<?php echo $key;?>" onchange="update(this);" /></td>
										<td><input type="text" value="<?php echo $v["priceinfant"];?>" name="priceinfant" datadate="<?php echo $key;?>" onchange="update(this);" /></td>
									  </tr>
									  <?php
									
										}
									  ?>
									 </table>
									<script type="text/javascript">
										function update(inputelement){
											var data=$(inputelement).val();
											var datadate=$(inputelement).attr("datadate");
											var code="<?php echo $cabinid; ?>";
											var numbernight="<?php echo $numbernight; ?>";
											var field=$(inputelement).attr("name");
											document.getElementById("loading").innerHTML = "<img src='<?php echo base_url(); ?>public/images/4-0.gif' />";
											$.post("<?php echo base_url(); ?>agency/checkrate/updatefield",{f:field,v:data,d:datadate,sc:code,n:numbernight},function (dataresponse){
												document.getElementById("loading").innerHTML = "<img src='<?php echo base_url(); ?>public/images/active_icon.gif' width='19' style='float:left;margin:0px 5px 3px 0px;' />Updated...";
												if(dataresponse!="ok"){
													alert(dataresponse);
												}
											});
										}
										$(document).ready(function (){
											$( ".date" ).datepicker({
											  changeMonth: true,
											  changeYear: true,
											  dateFormat:"yy-mm-dd"
											});
										});
									</script>
									</div>
                                </div>
							</div>
							<!--[if !IE]>end table_wrapper<![endif]-->
						</div>
						<span class="section_content_bottom"></span>
					</div>
					<!--[if !IE]>end section content<![endif]-->
				</div>